//
//  ZhenGrid.m
//  Utils
//
//  Created by enghou on 2018/4/24.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "ZhenGrid.h"
#import "QuGrid.h"
@implementation ZhenGrid
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.ids = [self contentForKey:@"id" withSource:source];
        self.isGrid = [[source objectForKey:@"isGrid"] boolValue];
        self.name = [self contentForKey:@"name" withSource:source];
        self.orgCode = [self contentForKey:@"orgCode" withSource:source];
        NSArray *orgVillages = [source objectForKey:@"orgVillages"];
        NSMutableArray *qus = [NSMutableArray array];
        for (NSDictionary *element in orgVillages) {
            QuGrid *qu = [[QuGrid alloc]initWithSource:element];
            [qus addObject:qu];
        }
        self.subOrgs = qus;
    }
    return self;
}
@end
